<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">

          <div class="layui-form-item">
              <label class="layui-form-label">公司ID</label>
              <div class="layui-input-block">
                  <input type="text" id="positionCompanyId" name="positionCompanyId"   autocomplete="off" placeholder="请输入公司ID"
                         class="layui-input">
              </div>
          </div>

          <div class="layui-form-item">
              <label class="layui-form-label">区域ID</label>
              <div class="layui-input-block">
                  <input type="text" id="positionAreaId" name="positionAreaId"   autocomplete="off" placeholder="请输入区域ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">薪资</label>
              <div class="layui-input-block">
                  <input type="text" id="positionSalary" name="positionSalary"   autocomplete="off" placeholder="请输入薪资"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">职位类型ID</label>
              <div class="layui-input-block">
                  <input type="text" id="positionIndustryId" name="positionIndustryId"   autocomplete="off" placeholder="请输入职位类型ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">职位联系人名字</label>
              <div class="layui-input-block">
                  <input type="text" id="positionUsername" name="positionUsername"   autocomplete="off" placeholder="请输入职位联系人名字"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">创建时间</label>
              <div class="layui-input-block">
                  <input type="text" id="poistionCreateTime" name="poistionCreateTime"   autocomplete="off" placeholder="请输入创建时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">职位修改时间</label>
              <div class="layui-input-block">
                  <input type="text" id="poistionUpdateTime" name="poistionUpdateTime"   autocomplete="off" placeholder="请输入职位修改时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">是否删除 0 正常/1删除</label>
              <div class="layui-input-block">
                  <input type="text" id="poistionIsDelete" name="poistionIsDelete"   autocomplete="off" placeholder="请输入是否删除 0 正常/1删除"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">职位要求</label>
              <div class="layui-input-block">
                  <input type="text" id="poistionRequirement" name="poistionRequirement"   autocomplete="off" placeholder="请输入职位要求"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">标签集合</label>
              <div class="layui-input-block">
                  <input type="text" id="poistionLabelIds" name="poistionLabelIds"   autocomplete="off" placeholder="请输入标签集合"
                         class="layui-input">
              </div>
          </div>

          <div class="layui-form-item">
              <label class="layui-form-label">职位详细地址</label>
              <div class="layui-input-block">
                  <input type="text" id="positionAddress" name="positionAddress"   autocomplete="off" placeholder="请输入职位详细地址"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">公司电话</label>
              <div class="layui-input-block">
                  <input type="text" id="positionPhone" name="positionPhone"   autocomplete="off" placeholder="请输入公司电话"
                         class="layui-input">
              </div>
          </div>

    <div class="layui-form-item">
        <label class="layui-form-label">职位描述</label>
        <div class="layui-input-block">
            <textarea id="demo" style="display: none;"></textarea>
        </div>
    </div>



    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>

    layui.use('layedit', function(){
        var layedit = layui.layedit;
        layedit.build('demo',{
            tool: [
                'strong' //加粗
                ,'italic' //斜体
                ,'underline' //下划线
                ,'del' //删除线

                ,'|' //分割线

                ,'left' //左对齐
                ,'center' //居中对齐
                ,'right' //右对齐
                ,'link' //超链接
                ,'unlink' //清除链接
                ,'face' //表情
                ,'help' //帮助
            ]
        }
        ); //建立编辑器



    })

    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;




        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         positionCompanyId:$("#positionCompanyId").val(),
                         positionAreaId:$("#positionAreaId").val(),
                         positionSalary:$("#positionSalary").val(),
                positionIndustryId:$("#positionIndustryId").val(),
                         positionUsername:$("#positionUsername").val(),
                         poistionCreateTime:$("#poistionCreateTime").val(),
                         poistionUpdateTime:$("#poistionUpdateTime").val(),
                         poistionIsDelete:$("#poistionIsDelete").val(),
                         poistionRequirement:$("#poistionRequirement").val(),
                         poistionLabelIds:$("#poistionLabelIds").val(),
                         positionDescribe:$("#positionDescribe").val(),
                         positionAddress:$("#positionAddress").val(),
                           positionPhone:$("#positionPhone").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/WeChatUser/wechatPosition/admin/addWechatPosition",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/WeChatUser/wechatPosition/admin/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#positionCompanyId").val().length<1){
                       layer.msg("请输入公司ID");
                       return false;
                   }
                   if($("#positionAreaId").val().length<1){
                       layer.msg("请输入区域ID");
                       return false;
                   }
                   if($("#positionSalary").val().length<1){
                       layer.msg("请输入薪资");
                       return false;
                   }
                   if($("#positionIndustryId").val().length<1){
                       layer.msg("请输入职位类型ID");
                       return false;
                   }
                   if($("#positionUsername").val().length<1){
                       layer.msg("请输入职位联系人名字");
                       return false;
                   }
                   if($("#poistionCreateTime").val().length<1){
                       layer.msg("请输入创建时间");
                       return false;
                   }
                   if($("#poistionUpdateTime").val().length<1){
                       layer.msg("请输入职位修改时间");
                       return false;
                   }
                   if($("#poistionIsDelete").val().length<1){
                       layer.msg("请输入是否删除 0 正常/1删除");
                       return false;
                   }
                   if($("#poistionRequirement").val().length<1){
                       layer.msg("请输入职位要求");
                       return false;
                   }
                   if($("#poistionLabelIds").val().length<1){
                       layer.msg("请输入标签集合");
                       return false;
                   }
                   if($("#positionDescribe").val().length<1){
                       layer.msg("请输入职位描述");
                       return false;
                   }
                   if($("#positionAddress").val().length<1){
                       layer.msg("请输入职位详细地址");
                       return false;
                   }
                   if($("#positionPhone").val().length<1){
                       layer.msg("请输入公司电话");
                       return false;
                   }
        }
    });

</script>
</body>
</html>